package main

import (
	"fmt"
	"math/rand"
	"sort"
)

type myString []byte

func (ms myString) Len() int           { return len(ms) }
func (ms myString) Swap(i, j int)      { ms[i], ms[j] = ms[j], ms[i] }
func (ms myString) Less(i, j int) bool { return i < j }

func alpha(n int) []byte {
	a1 := []byte{65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
		97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122}
	a2 := []byte{}
	for range n {
		index := rand.Intn(52)
		a2 = append(a2, a1[index])
	}
	fmt.Printf("%s", string(a2))
	fmt.Println()
	sort.Sort(sort.Reverse(myString(a2)))
	fmt.Printf("%s", string(a2))
	fmt.Println()
	return a2
}
